package com.baizhi.controller;

import com.baizhi.entity.Order;
import com.baizhi.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("order")
public class OrderController {
    @Autowired
    private OrderService orderService;

    @RequestMapping("selectOrders")
    @ResponseBody
    public Map selectOrders(){
        Map map = new HashMap();
        List<Order> orders = orderService.selectOrders();
        map.put("code",0);
        map.put("data",orders);
        return map;
    }
}
